package project_phase4;

import java.util.Vector;

import project_phase3.Gender;

public class MatchCriteria {
	public boolean matchAge;
	public short ageLow = 0;
	public short ageHigh = 0;

	public boolean matchWeight;
	public short weightLow = 0;
	public short weightHigh = 0;

	public boolean matchHeight;
	public ContactHeight heightLow = null;
	public ContactHeight heightHigh = null;
	
	public boolean matchGender;
	private Vector<Gender> genders;
	
	public boolean matchOccupation;
	private Vector<Occupation> occupations;

	public float weightAge;
	public float weightWeight;
	public float weightHeight;
	public float weightGender;
	public float weightOccupation;
	
	public MatchCriteria() {
		matchAge = false;
		matchWeight = false;
		matchHeight = false;
		matchGender = false;
		matchOccupation = false;
		genders = new Vector<Gender>();
		occupations = new Vector<Occupation>();
		weightAge = 1.0f;
		weightWeight = 1.0f;
		weightHeight = 1.0f;
		weightGender = 1.0f;
		weightOccupation = 1.0f;
	}
	
	public Vector<Gender> getGenders() {
		return genders;
	}

	public Vector<Occupation> getOccupations() {
		return occupations;
	}

	public void addGender(Gender gender) {
		for(int i = 0; i < genders.size(); i++) {
			Gender test = (Gender) genders.get(i);
			if(test.equals(gender))
				return;
		}
		genders.add(gender);
	}

	public void addOccupation(Occupation occupation) {
		for(int i = 0; i < occupations.size(); i++) {
			Occupation test = (Occupation) occupations.get(i);
			if(test.equals(occupation))
				return;
		}
		occupations.add(occupation);
	}
	
	public String toString() {
		String ret = "MatchCriteria ";
		ret += "\nmatchAge: " + matchAge + " low " + ageLow + " high " + ageHigh;
		ret += "\nmatchWeight: " + matchWeight + " low " + weightLow + " high " + weightLow;
		ret += "\nmatchHeight: " + matchHeight + " low " + heightLow + " high " + heightLow;
		ret += "\nmatchGender: " + matchGender;
		ret += "\nmatchOccupation: " + matchOccupation;
		return ret;
	}
}
